package com.example.licslan;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author WEILIN
 */
@SpringBootApplication
@Slf4j
public class BootLin {

	public static void main(String[] args) {
		ApplicationContext ctx = SpringApplication.run(BootLin.class, args);
		//所有的bean
		String[] beanNames = ctx.getBeanDefinitionNames();
		//所有添加该注解的bean  @Configuration
		//String[] beanNames = ctx.getBeanNamesForAnnotation(RestController.class);
		//String[] beanNames = ctx.getBeanNamesForAnnotation(Configuration.class);
		log.info("bean总数:{}", ctx.getBeanDefinitionCount());
		int i = 0;
		for (String str : beanNames) {
			log.info("{},beanName:{}", ++i, str);
		}
	}

}
